<?php
require_once $mypath.$system_root.'/include/common.inc.php';
require_once AK_ROOT.'include/forecache.func.php';
$forecache = getforecache($currenturl);
require_once(AK_ROOT.'include/global.func.php');
$db = db();
require_once(AK_ROOT.'include/fore.inc.php');
if(empty($get_filename)) fore404();
$filename = ak_addslashes($get_filename);
if($html = $db->get_by('*', 'filenames', "filename='$filename'")) {
	$id = $html['id'];	
} else {
	$_path = pathinfo($filename);
	$filename = $_path['basename'];
	if($offset = strpos($filename, '.')) {
		$filename = substr($filename, 0, $offset);
	}
	if(a_is_int($filename)) {
		$id = $filename;
	} else {
		fore404();
	}
}
$html = foredisplay($id, 'item');
if($forecache === false) setforecache($currenturl, $html);
echo $html;
require_once(AK_ROOT.'include/exit.php');
?>